﻿<ContentType()>
Public Class BaseContent
    Implements IContent


    Public Property guid As System.Guid Implements IContent.guid

    Public Overrides Function Equals(obj As Object) As Boolean
        If obj Is Nothing Then Return False
        If Not TypeOf (obj) Is IContent Then Return False
        Return guid = DirectCast(obj, IContent).guid
    End Function

    Public Overrides Function GetHashCode() As Integer
        Return guid.GetHashCode
    End Function

    Public Overridable Sub onContentSave() Implements IContent.onContentSave

    End Sub


    Public Overrides Function ToString() As String
        Dim ref_text As ReferenceText = Me.GetType.getFirstAttribute(Of ReferenceText)()
        If ref_text IsNot Nothing Then Return ref_text.getReferenceText(Me)
        Return MyBase.ToString()
    End Function

End Class
